package com.rockcent.common.helper;

import org.slf4j.Logger;
import org.springframework.stereotype.Component;

/**
 * Created by oyhk on 16/5/5.
 */
public class LoggerHelper {

    public void errorLog(Logger log, Exception e) {
        log.error(e.getMessage());
        StackTraceElement[] stackTraceElements = e.getStackTrace();
        for (int i = 0; i < stackTraceElements.length; i++) {
            StackTraceElement stackTraceElement = stackTraceElements[i];
            log.error(stackTraceElement.toString());
        }
    }
}
